package SEApp.boxes.templates
{
	import SEApp.boxes.albums.se_previewItem;
	
	import UIFree.controls.uif_label;
	import UIFree.uif_component;
	
	import flash.geom.Rectangle;

	public class se_templateItem extends se_previewItem {
		public function se_templateItem(parent:uif_component, ax:int=0, ay:int=0, awidth:int=0, 
										aheight:int=0, a_data:Object=null, styleClass:String='') {
			super(parent, ax, ay, awidth, aheight, a_data, styleClass);
			if (data && data.hasOwnProperty('previewURL')) _prevImage.loadSource(a_data.previewURL);
			var inner: Rectangle = getInner();
			if (data && data.name)
				(new uif_label(this, inner.x, inner.y + inner.width, inner.width, 30, 'infoTmpl')).text = data.name;
		}
		
		override protected function sourceRect(): Rectangle {
			var rect: Rectangle = super.sourceRect();
			rect.height = rect.width;
			return rect;
		}
	}
}